@import './_main';

/* The main window */
.resultViewComponent {
  position:absolute;  
  z-index: 99999; 
  border : 1px solid darken($background, 20%);  
  top: 0;
  left: 0;  
  bottom: 0;
  right: 0;
  background-color: $background; 
  opacity: 1;
  visibility: hidden;
  display: none;
  color: $foreground;

  font-family: Consolas, monaco, monospace; 
  font-size: 14px;
  font-weight: 500;
  
  &.active {
    visibility: visible;
    display: block;
  }

  &, &:after, &:before {
    box-sizing: content-box;
  }
}

$border: 2px;
$menuBaseHeight: 20px;
$menuHeight: $menuBaseHeight * 2;

.resultViewMenuComponent {
  font-family: 'Montserrat', sans-serif;
  // text-transform: uppercase; 
  font-size: 13px;
  font-weight: 300;
  line-height: $menuHeight;
  flex: 1 100%;
  display: flex;
  flex-flow: row wrap;
  height: $menuHeight + $border;
  outline: 0 none;
  border-bottom: $border solid $background; 
   box-sizing: border-box;
  list-style: none;
  margin: 0; 
  
  background: $background-even;
  
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  -webkit-flex-flow: row wrap;
  flex-flow: row wrap;
  justify-content: flex-end;

  .resultViewMenuOpen {
    display: none;
    visibility: hidden;
  }

  a {
    outline: 0 none;
    text-decoration: none;
    display: block;
    padding: 0 $menuBaseHeight 0 $menuBaseHeight;
    color: darken(white, 20%);
    background: $background-even;
    box-sizing: border-box;
    height: 100%;

    &.active {
      background: $background;
      color:white;
      font-weight:400;
      border-bottom:2px solid $foreground-important;
    }

    &:hover {
      background: $background;
      color: $foreground-focus;      
      cursor: pointer;
      transition: color $transition-time;
      -webkit-transition: color $transition-time;
      -moz-transition: color $transition-time;

      &.active {
        color: $foreground-important;
        transition: color 0;
        -webkit-transition: color 0;
        -moz-transition: color 0;
      } 
    }

    &.clearSearch {
      // display: inline-block;
      padding: 0px; 
      margin-left: -30px;
      margin-right: 20px;
      z-index: 9000;
      color: $foreground;    
      
      &:hover {
        background: $background-even;
        color: $foreground-important; 
      }
    }
  }

  @media all and (max-width: 1024px) {
    .resultViewMenuOpen {
      display: block;
      visibility: visible;
    }

    li:not(.resultViewMenuSmall) {
      display: none;
      visibility: hidden;
    }

    li {
      background: $background-even;
    }
    li.searchContainer {
      background: lighten($background-even, 10%);
    }
    
    padding: 0px;
    position: absolute;
    overflow-y: visible;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    z-index: 999999;
    display: block;

    a.active {
      background: $background-even;
    }
  }

  input {
    border: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    padding:0 $menuBaseHeight 0 $menuBaseHeight;
    // line-height: 20px;
    // margin: 20px - $margin;
    // padding: $margin;
    background: lighten($background-even, 10%);
    color: $foreground;
    height: $menuHeight; 
    position:relative;
    top:-1px; // because of ul.border
    box-sizing: border-box;

    &:focus {
      // border : 2px solid $background;
      border: 0;
      // box-shadow: 0 0px 0px $foreground inset, 0 0 2px $foreground-important;
      outline: 0 none;
    }
  }

  .clearSearch {
    position:relative;
    background:transparent;
    display: inline;
    padding: 0px;
    margin-left: -30px;
    z-index: 9000;
    color: $foreground-important;
    
    &:hover {
      background:transparent !important;
    }
  }

  ::-webkit-input-placeholder { /* WebKit, Blink, Edge */
    color:  darken(white, 20%);
  }
  :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color:  darken(white, 20%); 
  }
  ::-moz-placeholder { /* Mozilla Firefox 19+ */
    color:  darken(white, 20%); 
  }
  :-ms-input-placeholder { /* Internet Explorer 10-11 */
    color:  darken(white, 20%); 
  }
}

.resultViewContentComponent {
  position:absolute; 
  top: $menuHeight;
  left: 0;  
  bottom: 0;
  right: 0;
}

.informationColumnLeftComponent {
  position:absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 50%;
  overflow: auto;
  overflow-x: hidden;
  overflow-y: visible;
}

.informationColumnRightComponent {
  position:absolute; 
  top: 0;
  left: 50%;
  bottom: 0;
  right: 0;
  overflow: auto;
  overflow-x: hidden;
  overflow-y: visible;
}

.captureListComponent {
  position:absolute; 
  top: $menuHeight;
  left: 0;  
  bottom: 0;
  right: 0;
  background: $background;
  z-index: 9000;
  display: none;
  visibility: hidden;  
  overflow-y: visible;
  overflow-x: hidden;

  &.active {
    display: block;
    visibility: visible;
  }

  .openCaptureFile {
    border: 1px dashed $foreground;
    display: block;
    margin: $margin;
    padding: $margin;
    text-align: center;
    font-style: italic;
    
    span {
      line-height: 100%;
      vertical-align: middle;
    }
  }

  ul {
    margin: 0px;
    padding: 0px;
    list-style: none;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;    
    -webkit-flex-flow: row wrap;
    flex-flow: row wrap;
    justify-content: flex-start;

    li {
      margin: $margin;
      border : 1px solid darken($foreground, 60%);

      img {
        width: 300px - $margin;
        @include img-checkboard();
        display: block;
      }

      span {
        display: block;
        text-align: center;
        border: $margin solid $background;

        .captureListItemSave {
          color: $foreground;
          font-size: 16px;
          margin-left: 10px;
          position: relative;
          padding: 3px 8px 3px 32px;
          
          &:before, &:after {
            box-sizing: border-box;
            content: "";
            position: absolute;
          }
          &:before {
            background: $foreground-light;
            border-color: $foreground;
            border-style: solid;
            border-width: 7px 2px 1px;
            border-radius: 1px;
            height: 16px;
            left: 8px;
            top: 5px;
            width: 16px;
          }
          &:after {
            background: $foreground;
            border-color: $foreground-light;
            border-style: solid;
            border-width: 1px 1px 1px 4px;
            height: 5px;
            left: 13px;
            top: 5px;
            width: 7px;
          }
        }
      }

      &:hover {
        cursor: pointer;
      }

      &.active {
        span {
          background: $selected;
          border: $margin solid $selected;

          .captureListItemSave {
            &:before {
              background: $foreground-important
            }
            &:after {
              border-color: $foreground-important;
            }
          }
        }
      }
    }
  }
}

$visualStateListComponentWidth: 20%;
.visualStateListComponent {
  position:absolute; 
  top: 0;
  left: 0;
  bottom: 0;
  padding:5px;
  right: 100% - $visualStateListComponentWidth;
  overflow-y: visible;
  overflow-x: hidden;

  ul {
    margin: 0px;
    padding: 0px;
    list-style: none;
    li {
      margin: 20px 15px 0px 15px; 
      border : 1px solid darken($foreground, 60%);

      img {
        display: block;
        padding:0px;
        box-sizing: border-box;
        max-height: 600px;
        width: 100%;
        margin: 0 auto;
        @include img-checkboard();
      }

      &:hover {
        cursor: pointer;
      }

      span {
          border: $margin solid $background;
          background: $background;
          box-sizing: border-box;
          display: inline-block;
          width:100%;
          margin:0px;
          padding:5px;
          word-wrap: break-word;
      }

      &.active {
        // span {
            border: 2px solid $foreground-important;
            // box-sizing: border-box;
            // background: $foreground-important;
            // color:#333;
        // }
      }
    }
  }
}

$commandDetailComponentWidth: 40%;
.commandListComponent {
  position:absolute; 
  top: 0;
  left: $visualStateListComponentWidth; 
  right: $commandDetailComponentWidth;
  bottom: 0;
  color:darken($foreground, 15%);  

  ul {
    margin: 0px;
    padding: 0px;
    list-style: none;
    overflow-y: visible;
    overflow-x: hidden;
    height:100%;

    li {
      padding: 8px;

      span {
        word-wrap: break-word;
        line-height: 22px;
      }

      &:hover {
        @include on-hover();
      }

      &:nth-child(even) {
        background: $background-even;
      }

      &:nth-child(odd) {        
        background: $background;
      }

      .important{
        font-weight: 800;
        // &.unknown {
        // }
        &.deprecated {
            color: red;
        }
        &.unused {
            color: yellow;
        }
        &.disabled {
            color: gray;
        }
        &.redundant {
            color: orange;
        }
        &.valid {
            color: greenyellow;
        }
      }

      .marker{
        font-size: 16px;
        font-weight: 900;
        color: greenyellow;
      }

      &.active {
        background: lighten($selected, 6%); 
        color:#222;
      }

      &.drawCall {
        background: $foreground-title;
        color:#222;
      }

      a {
        margin-left: $margin;
        margin-right: $margin;
        color: $foreground-title;
        background: $background;
        padding: $margin;
        font-weight: 900;
        display: inline-block;
      }
    }
  }
}

.commandDetailComponent {
  position:absolute; 
  top: 0;
  left: 100% - $commandDetailComponentWidth; 
  right: 0;
  bottom: 0;
  overflow-y: visible;
  overflow-x: hidden;
}

.jsonGroupComponent {
  display: block;
  margin: 10px;
  padding:10px;
  padding-bottom: $margin;

  .jsonGroupComponentTitle {
    display: block;
    font-size: 16px;
    color: $foreground-title;
    border-bottom: 1px solid $foreground-title;
    padding-bottom: $margin;
    margin-bottom: $margin;
    text-transform: capitalize;
  }

  ul {
    margin: 0px;
    padding: 0px;
    list-style: none;

    li {
      &:nth-child(even) {
        background: $background;
      }

      &:nth-child(odd) {        
        background: $background;
      }
    } 
  }
}

.jsonItemComponentKey {
  color: $foreground-important;
}

.jsonItemComponentValue {
  white-space: pre-wrap;
}

.jsonItemImageHolder {
  width:50%;
  margin:auto;

  .jsonItemImage {
    margin: 5px;
    display:block;
    border : 1px solid darken($foreground, 60%);
    width:100%;

    img {
      width: 100%;
      display: block;
      margin: auto;
      max-width: 256px;
      @include img-checkboard();
    }

    span {
      margin: 0px;
      padding: 5px;
      word-wrap: break-word;
      display: inline-block;
      width: 100%;
      box-sizing: border-box;
    }
  }
}

[commandName=onOpenSourceClicked] {
  &:hover {
    @include on-hover();
  }
}

.jsonVisualStateItemComponent {
  text-align: center;
  padding:10px;

  img {
    @include img-checkboard();
    border : 1px solid darken($foreground, 60%);
    margin: $margin;
    width: 100%;
    max-width: 512px;
    max-height: 800px;
  }

  span {
    display: block;
  }
}

.jsonContentComponent {
  position:absolute; 
  top: 0;
  left: 0; 
  right: 0;
  bottom: 0;
  padding:10px; 
  overflow-y: visible;
  overflow-x: hidden;
}

.jsonItemComponentValue {
  word-break: break-all;
  white-space: normal; 
}

.jsonSourceItemComponentOpen {
  font-weight: bold;
  color: $foreground-title;
  text-decoration: underline;
}

.sourceCodeMenuComponentContainer {
  position: absolute;
  left: 0;
  top: 0;
  right: $commandDetailComponentWidth;
}

.sourceCodeMenuComponent {
  font-family: 'Montserrat', sans-serif;
  // text-transform: uppercase; 
  font-size: 13px;
  font-weight: 300;
  line-height: $menuHeight;
  flex: 1 100%;
  display: flex;
  flex-flow: row wrap;
  height: $menuHeight + $border;
  outline: 0 none;
  border-bottom: $border solid $background; 
   box-sizing: border-box;
  list-style: none;
  margin: 0; 
  
  background: $background-even;
  
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  -webkit-flex-flow: row wrap;
  flex-flow: row wrap;
  justify-content: flex-end;

  .resultViewMenuOpen {
    display: none;
    visibility: hidden;
  }

  a {
    outline: 0 none;
    text-decoration: none;
    display: block;
    padding: 0 $menuBaseHeight 0 $menuBaseHeight;
    color: darken(white, 20%);
    background: $background-even;
    box-sizing: border-box;
    height:100%;  

    &.active {
      background: $background;
      color:white;
      font-weight:400;
      border-bottom:2px solid $foreground-important;
    }

    &:hover {
      background: $background;
      color: $foreground-focus;      
      cursor: pointer;
      transition: color $transition-time;
      -webkit-transition: color $transition-time;
      -moz-transition: color $transition-time;

      &.active {
        color: $foreground-important;
        transition: color 0;
        -webkit-transition: color 0;
        -moz-transition: color 0;
      } 
    }

    &.clearSearch {
      display: inline-block;
      padding: 0px; 
      margin-left: -30px;
      margin-right: 20px;
      z-index: 9000;
      color: $foreground;    
      
      &:hover {
        background: $background-even;
        color: $foreground-important; 
      }
    }
  }

  input {
    border: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    padding:0 $menuBaseHeight 0 $menuBaseHeight;
    // line-height: 20px;
    // margin: 20px - $margin;
    // padding: $margin;
    background: lighten($background-even, 10%);
    color: $foreground;
    height:100%; 
    position:relative;
    top:-1px; // because of ul.border
    box-sizing: border-box;

    &:focus {
      // border : 2px solid $background;
      border: 0;
      // box-shadow: 0 0px 0px $foreground inset, 0 0 2px $foreground-important;
      outline: 0 none;
    }
  }

  .clearSearch {
    position:relative;
    background:transparent;
    display: inline;
    padding: 0px;
    margin-left: -30px;
    z-index: 9000;
    color: $foreground-important;
    
    &:hover {
      background:transparent !important;
    }
  }

  ::-webkit-input-placeholder { /* WebKit, Blink, Edge */
    color:  darken(white, 20%);
  }
  :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color:  darken(white, 20%); 
  }
  ::-moz-placeholder { /* Mozilla Firefox 19+ */
    color:  darken(white, 20%); 
  }
  :-ms-input-placeholder { /* Internet Explorer 10-11 */
    color:  darken(white, 20%); 
  }
}

.sourceCodeComponentEditable,.sourceCodeComponent {
  position:absolute; 
  top: $menuHeight + $border;
  left: 0;  
  bottom: 0;
  right: $commandDetailComponentWidth;
  background: $background;
  z-index: 9000;
  
  overflow-x: visible;
  overflow: auto;

  .sourceCodeComponentTitle {
    font-size: 16px;
    font-weight: 800;
    line-height: 50px;
    color: $foreground-important;
    padding: 1em;
    margin: .5em 0;
  }
}